<template>
	<div>
		<ul>
			<li v-for="(val,index) in arr" :key="index">{{val}}</li>
		</ul>
		<button @click="revBtn">数组反转</button>
		<button @click="sliceBtn">截取前三个</button>
	</div>
</template>

<script>
	export default {
		data(){
			return{
				arr:[5,3,9,2,1]
			}
		},
		methods:{
			revBtn(){
				this.arr.reverse()
			},
			sliceBtn(){
				this.arr.slice(0,3)
			}
		}
			
	};
</script>

<style>
</style>
